import router from '@/router/index'
import { getConcern } from '@/api/api'
import { onMounted, ref } from 'vue'
// import useZBStore from '@/pinia/index'
// const useStore = useZBStore()
export function useConcern() {
    const changeDetails = (uid) => {
        if (!uid) router.replace('/concern')
        router.push({ name: 'restaurantCard', query: { uid } })
        // 将id存入本地
        // useStore.setuId(uid)
        localStorage.setItem('uId', uid)
    }
    const concernList = ref([])
    onMounted(async () => {
        let { data } = await getConcern()
        concernList.value = data
        console.log(data)
    })
    return {
        changeDetails,
        concernList
    }
}
